n=int(input())
Xlst = list(map(int,input().split()))
Ylst = list(map(int,input().split()))
Zlst = list(map(int,input().split()))
newX = sorted([Xlst[i] - Ylst[i] - Zlst[i] for i in range(n)], reverse=True)
newY = sorted([Ylst[i] - Xlst[i] - Zlst[i] for i in range(n)], reverse=True)
newZ = sorted([Zlst[i] - Ylst[i] - Xlst[i] for i in range(n)], reverse=True)
time = -1
x = y = z = 0
for i in range(n):
    x += newX[i]
    y += newY[i]
    z += newZ[i]
    if x > 0 or y > 0 or z > 0:
        time = max(time,i+1)
print(time if time != -1 else -1)
